<%@ page import="BL.AccessDB"%>
<%
	HttpSession sess = request.getSession();

	String[] kat = AccessDB.getKat();
	String[] subKat;
	String selKat = request.getParameter("kategorie");
	String selSubkat = request.getParameter("subKategorie");
	if (selKat == null || selKat.equals("Bitte waehlen")) {
		subKat = null;
	} else {
		subKat = AccessDB.getSubKat(selKat);
	}
%>


<!DOCTYPE html>
<html>
<head>
<meta name="viewport"
	content="width=device-width, initial-scale=1, user-scalable=no" />
<style type="text/css">
html {
	height: 100%
}

body {
	height: 100%;
	margin: 0px;
	padding: 0px
}

#map_canvas {
	height: 100%
}
</style>
<script
	src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=true">
	
</script>

<script>
	var markersArray = [];
	function initialize() {
		var mapProp = {
			center : new google.maps.LatLng(49.34662, 9.134338),
			zoom : 13,
			mapTypeId : google.maps.MapTypeId.ROADMAP
		};
		var map = new google.maps.Map(document.getElementById("googleMap"),
				mapProp);

		google.maps.event.addListener(map, 'click', function(e) {
			setLang(e.latLng.lng());
			setLat(e.latLng.lat());
			clearOverlays();
			placeMarker(e.latLng, map);
		});
	}

	function setLang(lng) {
		//alert('Pos: '+position);
		var lang = document.getElementById('lang');
		lang.value = String(lng);
	}
	function setLat(lng) {
		//alert('Pos: '+position);
		var lat = document.getElementById('lat');
		lat.value = String(lng);
	}

	function placeMarker(position, map) {
		var marker = new google.maps.Marker({
			position : position,
			map : map
		});
		//map.panTo(position);
		markersArray.push(marker);
	}

	function clearOverlays() {
		if (markersArray) {
			for (i in markersArray) {
				markersArray[i].setMap(null);
			}
		}
	}

	function showAddress(address) {

		geocoder = new google.maps.Geocoder();

		geocoder.geocode({
			'address' : address

		}, function(results, status) {
			if (status == google.maps.GeocoderStatus.OK) {
				myOptions = {
					zoom : 13,
					center : results[0].geometry.location,
					mapTypeId : google.maps.MapTypeId.ROADMAP
				};
				lat = results[0].geometry.location.lat();
				lng = results[0].geometry.location.lng();
			} else {
				alert("Geocode was not successful for the following reason: "
						+ status);
			}
		});
	}

	google.maps.event.addDomListener(window, 'load', initialize);
</script>
<title>Location Based Service</title>
</head>
<body>
	<jsp:include page="header.jsp" />
	<hr>
	<h2>Eintrag hinzuf&uumlgen:</h2>
	<b><i>Markieren Sie hier Ihren Eintrag</i></b>
	<div id="googleMap" style="width: 100%; height: 70%;"></div>
	<%
		//<input type="text" id="geheZu"></input>
		//<input type="submit" value="Gehe Zu" onsubmit="showAddress(this.geheZu.value)"></input>
	%>
	<br>
	<br>
	<b>Details des neuen Eintrags:</b>
	<form method=post action="centralServlet">
		<input type="hidden" name="act" value="eintragHinzufuegen"></input>
		<table>
			<tr>
				<th align="left">Name:</th>
				<%
					if (request.getParameter("eintr_name") == null) {
				%>
				<td><input type=text name="eintr_name"></input></td>
				<%
					} else {
				%>
				<td><input type=text name="eintr_name"
					value="<%=request.getParameter("eintr_name")%>"></input></td>
				<%
					}
				%>
			</tr>
			<tr>
				<th align="left">Breitengrad:</th>
				<%
					if (request.getParameter("lat") == null) {
				%>
				<td><input type="text"  name="lat" id="lat"></input></td>
				<%
					} else {
				%>
				<td><input type="text"  name="lat" id="lat"
					value="<%=request.getParameter("lat")%>"></input></td>
				<%
					}
				%>
			</tr>
			<tr>
				<th align="left">Laengengrad:</th>
				<%
					if (request.getParameter("lang") == null) {
				%>
				<td><input type="text"  name="lang" id="lang"></input></td>
				<%
					} else {
				%>
				<td><input type="text"  name="lang" id="lang"
					value="<%=request.getParameter("lang")%>"></input></td>
				<%
					}
				%>
			</tr>
			<tr>
				<th align="left">Kategorie:</th>
				<td><select id="kategorie" name="kategorie"
					onchange="this.form.submit()">
						<option>Bitte waehlen</option>
						<%
							for (int i = 0; i < kat.length; i++) {
								if (selKat != null && selKat.equals(kat[i])) {
									out.println("<option selected>" + kat[i] + "</option>");
								} else {
									out.println("<option>" + kat[i] + "</option>");
								}
							}
						%>
				</select></td>
			</tr>
			<tr>
				<th align="left">Subkategorie:</th>
				<td><select id="subKategorie" name="subKategorie">
						<%
							if (subKat == null) {
						%>
						<option>(leer)</option>
						<%
							} else {
						%>
						<option>Bitte waehlen</option>
						<%
							for (int i = 0; i < subKat.length; i++) {
									if (selSubkat != null && selSubkat.equals(subKat[i])) {
										out.println("<option selected>" + subKat[i]
												+ "</option>");
									} else {
										out.println("<option>" + subKat[i] + "</option>");
									}
								}
							}
						%>
				</select></td>
			</tr>
			<tr>
				<td valign="top" align="left"><b>Beschreibung:</b><br>max.
					200 Zeichen<br></td>
				<%
					if (request.getParameter("beschreibung") == null) {
				%>
				<td><textarea name="beschreibung" rows="7" maxlength="200"></textarea></td>
				<%
					} else {
				%>
				<td><textarea name="beschreibung" rows="7" maxlength="200"><%=request.getParameter("beschreibung")%></textarea></td>
				<%
					}
				%>

			</tr>
			<tr>
				<td valign="top" align="left"><b>Bewertung:</b><br>1:
					Miserabel<br>10: Perfekt!</td>
				<td>
					<%
						for (int i = 1; i <= 10; i++) {
							if (request.getParameter("bewertung") != null) {
								if (Integer.parseInt(request.getParameter("bewertung")) == i) {
									out.println("<input type='radio' name='bewertung' checked='checked' value='"
											+ i + "'>" + i + "");
								} else {
									out.println("<input type='radio' name='bewertung' value='"
											+ i + "'>" + i + "");
								}
							}else {
								out.println("<input type='radio' name='bewertung' value='"
										+ i + "'>" + i + "");
							}

						}
					%>
				
			</tr>
			<tr>
				<th valign="top" align="left">&Oumlffnungszeiten</th>
			</tr>
			<tr>
				<table>
					<tr>
						<td></td>
						<td colspan="2">vormittags</td>
						<td colspan="2">nachmittags</td>
					</tr>
					<tr>
						<!-- *********************************************************************** Montag Vormittag -->
						<td>Mo.:</td>
						<td><select name="vvm1" onchange="this.form.submit()">
								<%
									for (int s = 0; s < 12; s++) {
										for (int m = 0; m <= 45; m = m + 15) {
											if (request.getParameter("vvm1") == null) {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
												if (Integer.parseInt(request.getParameter("vvm1")
														.substring(0, 2)) == s
														&& Integer.parseInt(request
																.getParameter("vvm1").substring(3)) == m) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
											}
										}
									}
								%>
						</select></td>
						<td><select name="bvm1">
								<%
									boolean zeileSchreiben = true;
									String zeitBvmZuvor = null;
									if (request.getParameter("bvm1") != null) {
										zeitBvmZuvor = request.getParameter("bvm1");
									} else {
										zeitBvmZuvor = new String("12:00");
									}
									if (request.getParameter("vvm1") == null) {
										for (int s = 0; s <= 12; s++) {
											for (int m = 0; m <= 45; m = m + 15) {

												if (s == 12 && m != 0)
													zeileSchreiben = false;

												if (zeileSchreiben) {
													if (s == 12 && m == 0) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
												}
												zeileSchreiben = true;
											}
										}
									} else {
										zeileSchreiben = true;
										String zeitZuvor = request.getParameter("vvm1");
										int sZuvor = Integer.parseInt(zeitZuvor.substring(0, 2));
										int mZuvor = Integer.parseInt(zeitZuvor.substring(3));
										for (int s = sZuvor; s <= 12; s++) {
											for (int m = 0; m <= 45; m = m + 15) {
												if (!(s == sZuvor && m < mZuvor)) {

													if (s == 12 && m != 0)
														zeileSchreiben = false;

													if (zeileSchreiben) {
														if (s == Integer.parseInt(zeitBvmZuvor
																.substring(0, 2))
																&& m == Integer.parseInt(zeitBvmZuvor
																		.substring(3))) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
													}
												}
											}
										}

									}
								%>

						</select></td>
						<!-- *********************************************************************** Montag Nachmittag -->
						<td><select name="vnm1" onchange="this.form.submit()">
								<%
									for (int s = 12; s < 24; s++) {
										for (int m = 0; m <= 45; m = m + 15) {
											if (request.getParameter("vnm1") == null) {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
												if (Integer.parseInt(request.getParameter("vnm1")
														.substring(0, 2)) == s
														&& Integer.parseInt(request
																.getParameter("vnm1").substring(3)) == m) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
											}
										}
									}
								%>
						</select></td>
						<td><select name="bnm1">
								<%
									zeileSchreiben = true;
									zeitBvmZuvor = null;
									if (request.getParameter("bnm1") != null) {
										zeitBvmZuvor = request.getParameter("bnm1");
									} else {
										zeitBvmZuvor = new String("24:00");
									}
									if (request.getParameter("vnm1") == null) {
										for (int s = 12; s <= 24; s++) {
											for (int m = 0; m <= 45; m = m + 15) {

												if (s == 24 && m != 0)
													zeileSchreiben = false;

												if (zeileSchreiben) {
													if (s == 24 && m == 0) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
												}
												zeileSchreiben = true;
											}
										}
									} else {
										zeileSchreiben = true;
										String zeitZuvor = request.getParameter("vnm1");
										int sZuvor = Integer.parseInt(zeitZuvor.substring(0, 2));
										int mZuvor = Integer.parseInt(zeitZuvor.substring(3));
										for (int s = sZuvor; s <= 24; s++) {
											for (int m = 0; m <= 45; m = m + 15) {
												if (!(s == sZuvor && m < mZuvor)) {

													if (s == 24 && m != 0)
														zeileSchreiben = false;

													if (zeileSchreiben) {
														if (s == Integer.parseInt(zeitBvmZuvor
																.substring(0, 2))
																&& m == Integer.parseInt(zeitBvmZuvor
																		.substring(3))) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
													}
												}
											}
										}

									}
								%>

						</select></td>
					</tr>


					</tr>
					<tr>
						<!-- *********************************************************************** Dienstag Vormittag -->
						<td>Di.:</td>
						<td><select name="vvm2" onchange="this.form.submit()">
								<%
									for (int s = 0; s < 12; s++) {
										for (int m = 0; m <= 45; m = m + 15) {
											if (request.getParameter("vvm1") == null) {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
												if (Integer.parseInt(request.getParameter("vvm2")
														.substring(0, 2)) == s
														&& Integer.parseInt(request
																.getParameter("vvm2").substring(3)) == m) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
											}
										}
									}
								%>
						</select></td>
						<td><select name="bvm2">
								<%
									zeileSchreiben = true;
									zeitBvmZuvor = null;
									if (request.getParameter("bvm2") != null) {
										zeitBvmZuvor = request.getParameter("bvm2");
									} else {
										zeitBvmZuvor = new String("12:00");
									}
									if (request.getParameter("vvm2") == null) {
										for (int s = 0; s <= 12; s++) {
											for (int m = 0; m <= 45; m = m + 15) {

												if (s == 12 && m != 0)
													zeileSchreiben = false;

												if (zeileSchreiben) {
													if (s == 12 && m == 0) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
												}
												zeileSchreiben = true;
											}
										}
									} else {
										zeileSchreiben = true;
										String zeitZuvor = request.getParameter("vvm2");
										int sZuvor = Integer.parseInt(zeitZuvor.substring(0, 2));
										int mZuvor = Integer.parseInt(zeitZuvor.substring(3));
										for (int s = sZuvor; s <= 12; s++) {
											for (int m = 0; m <= 45; m = m + 15) {
												if (!(s == sZuvor && m < mZuvor)) {

													if (s == 12 && m != 0)
														zeileSchreiben = false;

													if (zeileSchreiben) {
														if (s == Integer.parseInt(zeitBvmZuvor
																.substring(0, 2))
																&& m == Integer.parseInt(zeitBvmZuvor
																		.substring(3))) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
													}
												}
											}
										}

									}
								%>
						</select></td>
						<!-- *********************************************************************** Dienstag Nachmittag -->
						<td><select name="vnm2" onchange="this.form.submit()">
								<%
									for (int s = 12; s < 24; s++) {
										for (int m = 0; m <= 45; m = m + 15) {
											if (request.getParameter("vnm2") == null) {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
												if (Integer.parseInt(request.getParameter("vnm2")
														.substring(0, 2)) == s
														&& Integer.parseInt(request
																.getParameter("vnm2").substring(3)) == m) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
											}
										}
									}
								%>
						</select></td>
						<td><select name="bnm2">
								<%
									zeileSchreiben = true;
									zeitBvmZuvor = null;
									if (request.getParameter("bnm2") != null) {
										zeitBvmZuvor = request.getParameter("bnm2");
									} else {
										zeitBvmZuvor = new String("24:00");
									}
									if (request.getParameter("vnm2") == null) {
										for (int s = 12; s <= 24; s++) {
											for (int m = 0; m <= 45; m = m + 15) {

												if (s == 24 && m != 0)
													zeileSchreiben = false;

												if (zeileSchreiben) {
													if (s == 24 && m == 0) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
												}
												zeileSchreiben = true;
											}
										}
									} else {
										zeileSchreiben = true;
										String zeitZuvor = request.getParameter("vnm2");
										int sZuvor = Integer.parseInt(zeitZuvor.substring(0, 2));
										int mZuvor = Integer.parseInt(zeitZuvor.substring(3));
										for (int s = sZuvor; s <= 24; s++) {
											for (int m = 0; m <= 45; m = m + 15) {
												if (!(s == sZuvor && m < mZuvor)) {

													if (s == 24 && m != 0)
														zeileSchreiben = false;

													if (zeileSchreiben) {
														if (s == Integer.parseInt(zeitBvmZuvor
																.substring(0, 2))
																&& m == Integer.parseInt(zeitBvmZuvor
																		.substring(3))) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
													}
												}
											}
										}

									}
								%>

						</select></td>
					</tr>

					<tr>
						<!-- *********************************************************************** Mittwoch Vormittag -->
						<td>Mi.:</td>
						<td><select name="vvm3" onchange="this.form.submit()">
								<%
									for (int s = 0; s < 12; s++) {
										for (int m = 0; m <= 45; m = m + 15) {
											if (request.getParameter("vvm3") == null) {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
												if (Integer.parseInt(request.getParameter("vvm3")
														.substring(0, 2)) == s
														&& Integer.parseInt(request
																.getParameter("vvm3").substring(3)) == m) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
											}
										}
									}
								%>
						</select></td>
						<td><select name="bvm3">
								<%
									zeileSchreiben = true;
									zeitBvmZuvor = null;
									if (request.getParameter("bvm3") != null) {
										zeitBvmZuvor = request.getParameter("bvm3");
									} else {
										zeitBvmZuvor = new String("12:00");
									}
									if (request.getParameter("vvm3") == null) {
										for (int s = 0; s <= 12; s++) {
											for (int m = 0; m <= 45; m = m + 15) {

												if (s == 12 && m != 0)
													zeileSchreiben = false;

												if (zeileSchreiben) {
													if (s == 12 && m == 0) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
												}
												zeileSchreiben = true;
											}
										}
									} else {
										zeileSchreiben = true;
										String zeitZuvor = request.getParameter("vvm3");
										int sZuvor = Integer.parseInt(zeitZuvor.substring(0, 2));
										int mZuvor = Integer.parseInt(zeitZuvor.substring(3));
										for (int s = sZuvor; s <= 12; s++) {
											for (int m = 0; m <= 45; m = m + 15) {
												if (!(s == sZuvor && m < mZuvor)) {

													if (s == 12 && m != 0)
														zeileSchreiben = false;

													if (zeileSchreiben) {
														if (s == Integer.parseInt(zeitBvmZuvor
																.substring(0, 2))
																&& m == Integer.parseInt(zeitBvmZuvor
																		.substring(3))) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
													}
												}
											}
										}

									}
								%>
						</select></td>
						<!-- *********************************************************************** Dienstag Nachmittag -->
						<td><select name="vnm3" onchange="this.form.submit()">
								<%
									for (int s = 12; s < 24; s++) {
										for (int m = 0; m <= 45; m = m + 15) {
											if (request.getParameter("vnm3") == null) {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
												if (Integer.parseInt(request.getParameter("vnm3")
														.substring(0, 2)) == s
														&& Integer.parseInt(request
																.getParameter("vnm3").substring(3)) == m) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
											}
										}
									}
								%>
						</select></td>
						<td><select name="bnm3">
								<%
									zeileSchreiben = true;
									zeitBvmZuvor = null;
									if (request.getParameter("bnm3") != null) {
										zeitBvmZuvor = request.getParameter("bnm3");
									} else {
										zeitBvmZuvor = new String("24:00");
									}
									if (request.getParameter("vnm3") == null) {
										for (int s = 12; s <= 24; s++) {
											for (int m = 0; m <= 45; m = m + 15) {

												if (s == 24 && m != 0)
													zeileSchreiben = false;

												if (zeileSchreiben) {
													if (s == 24 && m == 0) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
												}
												zeileSchreiben = true;
											}
										}
									} else {
										zeileSchreiben = true;
										String zeitZuvor = request.getParameter("vnm3");
										int sZuvor = Integer.parseInt(zeitZuvor.substring(0, 2));
										int mZuvor = Integer.parseInt(zeitZuvor.substring(3));
										for (int s = sZuvor; s <= 24; s++) {
											for (int m = 0; m <= 45; m = m + 15) {
												if (!(s == sZuvor && m < mZuvor)) {

													if (s == 24 && m != 0)
														zeileSchreiben = false;

													if (zeileSchreiben) {
														if (s == Integer.parseInt(zeitBvmZuvor
																.substring(0, 2))
																&& m == Integer.parseInt(zeitBvmZuvor
																		.substring(3))) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
													}
												}
											}
										}

									}
								%>

						</select></td>
					</tr>

					<tr>
						<!-- *********************************************************************** Donnerstag Vormittag -->
						<td>Do.:</td>
						<td><select name="vvm4" onchange="this.form.submit()">
								<%
									for (int s = 0; s < 12; s++) {
										for (int m = 0; m <= 45; m = m + 15) {
											if (request.getParameter("vvm4") == null) {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
												if (Integer.parseInt(request.getParameter("vvm4")
														.substring(0, 2)) == s
														&& Integer.parseInt(request
																.getParameter("vvm4").substring(3)) == m) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
											}
										}
									}
								%>
						</select></td>
						<td><select name="bvm4">
								<%
									zeileSchreiben = true;
									zeitBvmZuvor = null;
									if (request.getParameter("bvm4") != null) {
										zeitBvmZuvor = request.getParameter("bvm4");
									} else {
										zeitBvmZuvor = new String("12:00");
									}
									if (request.getParameter("vvm4") == null) {
										for (int s = 0; s <= 12; s++) {
											for (int m = 0; m <= 45; m = m + 15) {

												if (s == 12 && m != 0)
													zeileSchreiben = false;

												if (zeileSchreiben) {
													if (s == 12 && m == 0) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
												}
												zeileSchreiben = true;
											}
										}
									} else {
										zeileSchreiben = true;
										String zeitZuvor = request.getParameter("vvm4");
										int sZuvor = Integer.parseInt(zeitZuvor.substring(0, 2));
										int mZuvor = Integer.parseInt(zeitZuvor.substring(3));
										for (int s = sZuvor; s <= 12; s++) {
											for (int m = 0; m <= 45; m = m + 15) {
												if (!(s == sZuvor && m < mZuvor)) {

													if (s == 12 && m != 0)
														zeileSchreiben = false;

													if (zeileSchreiben) {
														if (s == Integer.parseInt(zeitBvmZuvor
																.substring(0, 2))
																&& m == Integer.parseInt(zeitBvmZuvor
																		.substring(3))) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
													}
												}
											}
										}

									}
								%>
						</select></td>
						<!-- *********************************************************************** Donnerstag Nachmittag -->
						<td><select name="vnm4" onchange="this.form.submit()">
								<%
									for (int s = 12; s < 24; s++) {
										for (int m = 0; m <= 45; m = m + 15) {
											if (request.getParameter("vnm4") == null) {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
												if (Integer.parseInt(request.getParameter("vnm4")
														.substring(0, 2)) == s
														&& Integer.parseInt(request
																.getParameter("vnm4").substring(3)) == m) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
											}
										}
									}
								%>
						</select></td>
						<td><select name="bnm4">
								<%
									zeileSchreiben = true;
									zeitBvmZuvor = null;
									if (request.getParameter("bnm4") != null) {
										zeitBvmZuvor = request.getParameter("bnm4");
									} else {
										zeitBvmZuvor = new String("24:00");
									}
									if (request.getParameter("vnm4") == null) {
										for (int s = 12; s <= 24; s++) {
											for (int m = 0; m <= 45; m = m + 15) {

												if (s == 24 && m != 0)
													zeileSchreiben = false;

												if (zeileSchreiben) {
													if (s == 24 && m == 0) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
												}
												zeileSchreiben = true;
											}
										}
									} else {
										zeileSchreiben = true;
										String zeitZuvor = request.getParameter("vnm4");
										int sZuvor = Integer.parseInt(zeitZuvor.substring(0, 2));
										int mZuvor = Integer.parseInt(zeitZuvor.substring(3));
										for (int s = sZuvor; s <= 24; s++) {
											for (int m = 0; m <= 45; m = m + 15) {
												if (!(s == sZuvor && m < mZuvor)) {

													if (s == 24 && m != 0)
														zeileSchreiben = false;

													if (zeileSchreiben) {
														if (s == Integer.parseInt(zeitBvmZuvor
																.substring(0, 2))
																&& m == Integer.parseInt(zeitBvmZuvor
																		.substring(3))) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
													}
												}
											}
										}

									}
								%>

						</select></td>
					</tr>

					<tr>
						<!-- *********************************************************************** Freitag Vormittag -->
						<td>Fr.:</td>
						<td><select name="vvm5" onchange="this.form.submit()">
								<%
									for (int s = 0; s < 12; s++) {
										for (int m = 0; m <= 45; m = m + 15) {
											if (request.getParameter("vvm5") == null) {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
												if (Integer.parseInt(request.getParameter("vvm5")
														.substring(0, 2)) == s
														&& Integer.parseInt(request
																.getParameter("vvm5").substring(3)) == m) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
											}
										}
									}
								%>
						</select></td>
						<td><select name="bvm5">
								<%
									zeileSchreiben = true;
									zeitBvmZuvor = null;
									if (request.getParameter("bvm5") != null) {
										zeitBvmZuvor = request.getParameter("bvm5");
									} else {
										zeitBvmZuvor = new String("12:00");
									}
									if (request.getParameter("vvm5") == null) {
										for (int s = 0; s <= 12; s++) {
											for (int m = 0; m <= 45; m = m + 15) {

												if (s == 12 && m != 0)
													zeileSchreiben = false;

												if (zeileSchreiben) {
													if (s == 12 && m == 0) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
												}
												zeileSchreiben = true;
											}
										}
									} else {
										zeileSchreiben = true;
										String zeitZuvor = request.getParameter("vvm5");
										int sZuvor = Integer.parseInt(zeitZuvor.substring(0, 2));
										int mZuvor = Integer.parseInt(zeitZuvor.substring(3));
										for (int s = sZuvor; s <= 12; s++) {
											for (int m = 0; m <= 45; m = m + 15) {
												if (!(s == sZuvor && m < mZuvor)) {

													if (s == 12 && m != 0)
														zeileSchreiben = false;

													if (zeileSchreiben) {
														if (s == Integer.parseInt(zeitBvmZuvor
																.substring(0, 2))
																&& m == Integer.parseInt(zeitBvmZuvor
																		.substring(3))) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
													}
												}
											}
										}

									}
								%>
						</select></td>
						<!-- *********************************************************************** Freitag Nachmittag -->
						<td><select name="vnm5" onchange="this.form.submit()">
								<%
									for (int s = 12; s < 24; s++) {
										for (int m = 0; m <= 45; m = m + 15) {
											if (request.getParameter("vnm5") == null) {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
												if (Integer.parseInt(request.getParameter("vnm5")
														.substring(0, 2)) == s
														&& Integer.parseInt(request
																.getParameter("vnm5").substring(3)) == m) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
											}
										}
									}
								%>
						</select></td>
						<td><select name="bnm5">
								<%
									zeileSchreiben = true;
									zeitBvmZuvor = null;
									if (request.getParameter("bnm5") != null) {
										zeitBvmZuvor = request.getParameter("bnm5");
									} else {
										zeitBvmZuvor = new String("24:00");
									}
									if (request.getParameter("vnm5") == null) {
										for (int s = 12; s <= 24; s++) {
											for (int m = 0; m <= 45; m = m + 15) {

												if (s == 24 && m != 0)
													zeileSchreiben = false;

												if (zeileSchreiben) {
													if (s == 24 && m == 0) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
												}
												zeileSchreiben = true;
											}
										}
									} else {
										zeileSchreiben = true;
										String zeitZuvor = request.getParameter("vnm5");
										int sZuvor = Integer.parseInt(zeitZuvor.substring(0, 2));
										int mZuvor = Integer.parseInt(zeitZuvor.substring(3));
										for (int s = sZuvor; s <= 24; s++) {
											for (int m = 0; m <= 45; m = m + 15) {
												if (!(s == sZuvor && m < mZuvor)) {

													if (s == 24 && m != 0)
														zeileSchreiben = false;

													if (zeileSchreiben) {
														if (s == Integer.parseInt(zeitBvmZuvor
																.substring(0, 2))
																&& m == Integer.parseInt(zeitBvmZuvor
																		.substring(3))) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
													}
												}
											}
										}

									}
								%>

						</select></td>
					</tr>

					<tr>
						<!-- *********************************************************************** Samstag Vormittag -->
						<td>Sa.:</td>
						<td><select name="vvm6" onchange="this.form.submit()">
								<%
									for (int s = 0; s < 12; s++) {
										for (int m = 0; m <= 45; m = m + 15) {
											if (request.getParameter("vvm6") == null) {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
												if (Integer.parseInt(request.getParameter("vvm6")
														.substring(0, 2)) == s
														&& Integer.parseInt(request
																.getParameter("vvm6").substring(3)) == m) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
											}
										}
									}
								%>
						</select></td>
						<td><select name="bvm6">
								<%
									zeileSchreiben = true;
									zeitBvmZuvor = null;
									if (request.getParameter("bvm6") != null) {
										zeitBvmZuvor = request.getParameter("bvm6");
									} else {
										zeitBvmZuvor = new String("12:00");
									}
									if (request.getParameter("vvm6") == null) {
										for (int s = 0; s <= 12; s++) {
											for (int m = 0; m <= 45; m = m + 15) {

												if (s == 12 && m != 0)
													zeileSchreiben = false;

												if (zeileSchreiben) {
													if (s == 12 && m == 0) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
												}
												zeileSchreiben = true;
											}
										}
									} else {
										zeileSchreiben = true;
										String zeitZuvor = request.getParameter("vvm6");
										int sZuvor = Integer.parseInt(zeitZuvor.substring(0, 2));
										int mZuvor = Integer.parseInt(zeitZuvor.substring(3));
										for (int s = sZuvor; s <= 12; s++) {
											for (int m = 0; m <= 45; m = m + 15) {
												if (!(s == sZuvor && m < mZuvor)) {

													if (s == 12 && m != 0)
														zeileSchreiben = false;

													if (zeileSchreiben) {
														if (s == Integer.parseInt(zeitBvmZuvor
																.substring(0, 2))
																&& m == Integer.parseInt(zeitBvmZuvor
																		.substring(3))) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
													}
												}
											}
										}

									}
								%>
						</select></td>
						<!-- *********************************************************************** Samstag Nachmittag -->
						<td><select name="vnm6" onchange="this.form.submit()">
								<%
									for (int s = 12; s < 24; s++) {
										for (int m = 0; m <= 45; m = m + 15) {
											if (request.getParameter("vnm6") == null) {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
												if (Integer.parseInt(request.getParameter("vnm6")
														.substring(0, 2)) == s
														&& Integer.parseInt(request
																.getParameter("vnm6").substring(3)) == m) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
											}
										}
									}
								%>
						</select></td>
						<td><select name="bnm6">
								<%
									zeileSchreiben = true;
									zeitBvmZuvor = null;
									if (request.getParameter("bnm6") != null) {
										zeitBvmZuvor = request.getParameter("bnm6");
									} else {
										zeitBvmZuvor = new String("24:00");
									}
									if (request.getParameter("vnm6") == null) {
										for (int s = 12; s <= 24; s++) {
											for (int m = 0; m <= 45; m = m + 15) {

												if (s == 24 && m != 0)
													zeileSchreiben = false;

												if (zeileSchreiben) {
													if (s == 24 && m == 0) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
												}
												zeileSchreiben = true;
											}
										}
									} else {
										zeileSchreiben = true;
										String zeitZuvor = request.getParameter("vnm6");
										int sZuvor = Integer.parseInt(zeitZuvor.substring(0, 2));
										int mZuvor = Integer.parseInt(zeitZuvor.substring(3));
										for (int s = sZuvor; s <= 24; s++) {
											for (int m = 0; m <= 45; m = m + 15) {
												if (!(s == sZuvor && m < mZuvor)) {

													if (s == 24 && m != 0)
														zeileSchreiben = false;

													if (zeileSchreiben) {
														if (s == Integer.parseInt(zeitBvmZuvor
																.substring(0, 2))
																&& m == Integer.parseInt(zeitBvmZuvor
																		.substring(3))) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
													}
												}
											}
										}

									}
								%>

						</select></td>
					</tr>

					<tr>
						<!-- *********************************************************************** Sonntag Vormittag -->
						<td>So.:</td>
						<td><select name="vvm7" onchange="this.form.submit()">
								<%
									for (int s = 0; s < 12; s++) {
										for (int m = 0; m <= 45; m = m + 15) {
											if (request.getParameter("vvm7") == null) {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
												if (Integer.parseInt(request.getParameter("vvm7")
														.substring(0, 2)) == s
														&& Integer.parseInt(request
																.getParameter("vvm7").substring(3)) == m) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
											}
										}
									}
								%>
						</select></td>
						<td><select name="bvm7">
								<%
									zeileSchreiben = true;
									zeitBvmZuvor = null;
									if (request.getParameter("bvm7") != null) {
										zeitBvmZuvor = request.getParameter("bvm7");
									} else {
										zeitBvmZuvor = new String("12:00");
									}
									if (request.getParameter("vvm7") == null) {
										for (int s = 0; s <= 12; s++) {
											for (int m = 0; m <= 45; m = m + 15) {

												if (s == 12 && m != 0)
													zeileSchreiben = false;

												if (zeileSchreiben) {
													if (s == 12 && m == 0) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
												}
												zeileSchreiben = true;
											}
										}
									} else {
										zeileSchreiben = true;
										String zeitZuvor = request.getParameter("vvm7");
										int sZuvor = Integer.parseInt(zeitZuvor.substring(0, 2));
										int mZuvor = Integer.parseInt(zeitZuvor.substring(3));
										for (int s = sZuvor; s <= 12; s++) {
											for (int m = 0; m <= 45; m = m + 15) {
												if (!(s == sZuvor && m < mZuvor)) {

													if (s == 12 && m != 0)
														zeileSchreiben = false;

													if (zeileSchreiben) {
														if (s == Integer.parseInt(zeitBvmZuvor
																.substring(0, 2))
																&& m == Integer.parseInt(zeitBvmZuvor
																		.substring(3))) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
													}
												}
											}
										}

									}
								%>
						</select></td>
						<!-- *********************************************************************** Sonntag Nachmittag -->
						<td><select name="vnm7" onchange="this.form.submit()">
								<%
									for (int s = 12; s < 24; s++) {
										for (int m = 0; m <= 45; m = m + 15) {
											if (request.getParameter("vnm7") == null) {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
												if (Integer.parseInt(request.getParameter("vnm7")
														.substring(0, 2)) == s
														&& Integer.parseInt(request
																.getParameter("vnm7").substring(3)) == m) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
											}
										}
									}
								%>
						</select></td>
						<td><select name="bnm7">
								<%
									zeileSchreiben = true;
									zeitBvmZuvor = null;
									if (request.getParameter("bnm7") != null) {
										zeitBvmZuvor = request.getParameter("bnm7");
									} else {
										zeitBvmZuvor = new String("24:00");
									}
									if (request.getParameter("vnm7") == null) {
										for (int s = 12; s <= 24; s++) {
											for (int m = 0; m <= 45; m = m + 15) {

												if (s == 24 && m != 0)
													zeileSchreiben = false;

												if (zeileSchreiben) {
													if (s == 24 && m == 0) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
												}
												zeileSchreiben = true;
											}
										}
									} else {
										zeileSchreiben = true;
										String zeitZuvor = request.getParameter("vnm7");
										int sZuvor = Integer.parseInt(zeitZuvor.substring(0, 2));
										int mZuvor = Integer.parseInt(zeitZuvor.substring(3));
										for (int s = sZuvor; s <= 24; s++) {
											for (int m = 0; m <= 45; m = m + 15) {
												if (!(s == sZuvor && m < mZuvor)) {

													if (s == 24 && m != 0)
														zeileSchreiben = false;

													if (zeileSchreiben) {
														if (s == Integer.parseInt(zeitBvmZuvor
																.substring(0, 2))
																&& m == Integer.parseInt(zeitBvmZuvor
																		.substring(3))) {
								%>
								<option selected><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									} else {
								%>
								<option><%=s / 10%><%=s % 10%><%=":"%><%=m / 10%><%=m % 10%></option>
								<%
									}
													}
												}
											}
										}

									}
								%>

						</select></td>
					</tr>

				</table>

			</tr>
		</table>
		<p>
		<p>
			<input type="submit" name="eintrAct" value="Eintrag hinzufuegen"></input>
	</form>
	<%
		if (sess.getAttribute("fehler") != null) {
			if (sess.getAttribute("fehler") != "")
				out.print("<script>alert('" + sess.getAttribute("fehler")
						+ "');</script>");
		}
	%>

	<p>
	<p>
	<hr>
	<jsp:include page="footer.jsp" /></body>

</html>
